Multi-Method Dispatch Using Single-Receiver Projections
نویسندگان
چکیده
A new technique for multi-method dispatch, called Single-Receiver Projections and abbreviated SRP, is presented. It operates by performing projections onto single-receiver dispatch tables, and thus benefits from existing research into single-receiver dispatch techniques. It provides method dispatch in O(k), where k is the arity of the method. Unlike existing multi-method dispatch techniques, it also maintains the set of all applicable methods. This extra information allows SRP to support languages like CLOS that use next-method. SRP is also highly incremental in nature, so it is well-suited for languages that require separate compilation and languages that allow methods and classes to be added at run-time. SRP uses less data-structure memory than all existing multi-method techniques and has the second fastest dispatch time. Furthermore, if the other techniques are extended to support all applicable methods, SRP becomes the fastest dispatch techniques.
منابع مشابه
Method Dispatch for Multi-Method Object-Oriented Languages
Two new techniques for multi-method dispatch are presented, both sufficiently general to apply to reflexive languages where methods and types can be added and removed at run-time. However, these techniques also apply to non-reflexive languages. One of the techniques operates by performing projections onto single-receiver dispatch tables, and thus benefits from existing research into single-rece...
متن کاملMulti - Method Dispatch Using Multiple
Multiple Row Displacement (MRD) is a new dispatch technique for multi-method languages. It is based on compressing an n-dimensional table using an extension of the single-receiver row displacement mechanism. This paper presents the new algorithm and provides experimental results that compare it with implementations of existing techniques: compressed n-dimensional tables, look-up automata and si...
متن کاملMulti-Dispatch in the Java Virtual Machine: Design and Implementation
Mainstream object-oriented languages, such as C++ and Java1, provide only a restricted form of polymorphic methods, namely uni-receiver dispatch. In common programming situations, developers must work around this limitation. We describe how to extend the Java Virtual Machine to support multi-dispatch and examine the complications that Java imposes on multidispatch in practice. Our technique avo...
متن کاملMulti-method Dispatch Using Multiple Row Displacement
Multiple Row Displacement (MRD) is a new dispatch technique for multi-method languages. It is based on compressing an n-dimensional table using an extension of the single-receiver row displacement mechanism. This paper presents the new algorithm and provides experimental results that compare it with implementations of existing techniques: compressed n-dimensional tables, look-up automata and si...
متن کاملTranslating Double Dispatch into Single Dispatch
Goals of flexibility and re-usability in typed object-oriented languages suggest the requirement of double dispatch, i.e., the mechanism of dynamically selecting a method not only according to the run-time type of the receiver (single dispatch), but also to the run-time type of the argument. However, many mainstream languages, such as, e.g., C++ and Java, do not provide it, resorting to only si...
متن کامل